const cheerio = require('cheerio')

function findImg(dom, callback) {
    let $ = cheerio.load(dom)
    // console.log(dom)

    $('img').each(function (index, ele) {
        let imgSrc = $(this).attr('src')
        // console.log($(this))
        callback(imgSrc, index)
    })
}

module.exports.findImg = findImg